-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override clone_from
for some types
#85176
Conversation
r? @yaahc (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 9332ac3 with merge ee90cb22627d2f2c6828fc4316225d34b4b8bd1a... |
☀️ Try build successful - checks-actions |
Queued ee90cb22627d2f2c6828fc4316225d34b4b8bd1a with parent 5c02926, future comparison URL. |
Finished benchmarking try commit (ee90cb22627d2f2c6828fc4316225d34b4b8bd1a): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
So am I correct in understanding that the changes here don't represent direct optimizations, but instead stop these wrappers from ignoring If that's the case I'd be happy to accept this PR but I think it might be better to try to address this problem in the |
Yes, a common example is an
This optimization is a bit niche, to be fair. I don't think that
It was proposed a long time ago (#27939), but it was closed due to the impact on compile times. With this PR, |
📌 Commit 9332ac3 has been approved by |
⌛ Testing commit 9332ac3 with merge fb84a8750d1f6cd2bdb8a2b96d4fb67a6997616c... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Looks like a spurious network error. |
@a1phyr: 🔑 Insufficient privileges: not in try users |
@bors retry |
☀️ Test successful - checks-actions |
Forwarding `clone_from` to the inner value changes the observable behavior, as previously the inner value would *not* be dropped by the default implementation.
…one-from, r=m-ou-se Revert rust-lang#85176 addition of `clone_from` for `ManuallyDrop` Forwarding `clone_from` to the inner value changes the observable behavior, as previously the inner value would *not* be dropped by the default implementation. Frankly, this is a super-niche case, so rust-lang#85176 is welcome to argue the behavior should be otherwise! But if we overrride it, IMO documenting the behavior would be good. Example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=c5d0856686fa850c1d7ee16891014efb
Forwarding `clone_from` to the inner value changes the observable behavior, as previously the inner value would *not* be dropped by the default implementation.
…ulacrum [beta] Bootstrap from stable This is the follow up to master/beta promotion, as well as the first round of backports: * Revert "Allow specifying alignment for functions rust-lang#81234" * Revert rust-lang#85176 addition of clone_from for ManuallyDrop rust-lang#85758 * rustdoc: revert deref recur to resume inclusion of impl ExtTrait<Local> for ExtType rust-lang#84867 * [beta] Update cargo rust-lang#86563 r? `@Mark-Simulacrum`
Override
clone_from
method of theClone
trait for:cell::RefCell
cmp::Reverse
io::Cursor
mem::ManuallyDrop
This can bring performance improvements.